<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='../vue.js'></script>
</head>

<body>
    <div id='app'>
        <m-com></m-com>
        <bigcom></bigcom>
    </div>
</body>
<!-- 定义组件模板 -->
<template id="mycom">
    <div>
        <h1>{{message}}</h1>
    </div>
</template>
<script>
    const app = Vue.createApp({
        data() {
            return {}
        },
        methods: {},
        components: {
            // 组件写名称最好不用小驼峰，否则的写成m-com，建议写成大驼峰
            mCom: {
                template: '#mycom',
                data() {
                    return {
                        // 组件数据
                        message: '春天到了，昨天都 30 度了。'
                    }
                },
            }
        },
    })
    app.component('bigcom',{
        template: '#mycom',
        data() {
            return {
                message: "今天是20.7.29"
            }
        },
         methods: {}
        
    })
    const vm = app.mount('#app')
</script>

</html>